package leetcode.editor.temp;
import java.util.*;

public class egg {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        List<Map<String, Integer>> myEgg = new ArrayList<>();
        List<Map<String, Integer>> badEgg = new ArrayList<>();
        while (--T>=0){
            int N = sc.nextInt(), M =sc.nextInt(), p = sc.nextInt(), q = sc.nextInt();// 宽高,我方敌方数量
            for (int i = 0; i < p; i++){
                Map map = new HashMap<String, Integer>();
                map.put("HP", sc.nextInt());
                map.put("ATK", sc.nextInt());
                map.put("DIST", sc.nextInt());
                map.put("originX", sc.nextInt());
                map.put("originY", sc.nextInt());
                myEgg.add(map);
            }
            for (int i = 0; i < q; i++) {
                Map map = new HashMap<String, Integer>();
                map.put("HP", sc.nextInt());
                map.put("ATK", sc.nextInt());
                map.put("DIST", sc.nextInt());
                map.put("originX", sc.nextInt());
                map.put("originY", sc.nextInt());
                badEgg.add(map);
            }
        }
        // 开始处理
        while (!badEgg.isEmpty() || !myEgg.isEmpty()){
            // 有血才能行动 没血直接在List中给这个egg remove
            for (int i = 0;i<myEgg.size();i++){
                Map egg = myEgg.get(i);
                 
            }
        }
    }
}
